<?php
namespace Act\Os\Payment;
use Act\Os\Backend;
class Disable extends Backend{
	public function doGet(){
		$code = get('code','','trim');
		$this->checkParam($code);
		$payment_cls = '\\Lib\\Payment\\'.$code.'\\'.$code;
		if(!class_exists($payment_cls)){
			return $this->error('该支付接口不存在',referer());
		}
		$payment_mod = model('#Payment');
		$ret = $payment_mod->disablePayment($code);
		if($ret!==false){
			return redirect('/os/payments');
		}else{
			return $this->error($payment_mod->getError(),referer());
		}
	}
}